function GDJC002reset()
{
	document.getElementById("lblMessage").innerText=" ";
	var inputs=document.getElementsByTagName("input");
	for(var i=0;i<inputs.length;i++)
	{
		if(inputs[i].type == "text" || inputs[i].type == "file")
		{
			inputs[i].value="";
		}
	}
	var FMemo=document.getElementById("FMemo");
	FMemo.value="";
	document.getElementById("FImgPath").value="";
	document.getElementById("preview").src = "uploadimages/dvd.jpg";
	return false;
};


function onFileSelected(file)
{
    var fvalue=file.value;
    var ext = fvalue.substring(fvalue.lastIndexOf(".")+1);
	var filter =new Array("bmp","jpg","jpeg","png");
	var extValid=false;
	for(var i=0; i<filter.length; i++)
	{
		if(filter[i] == ext)
		{
			extValid=true;
		}
	}
	if(extValid != true)
	{
		var message = "扩展名只支持 bmp,jpg,jpeg,png";
		file.value="";
		alert(message);
		return false;
	}
	document.getElementById("preview").src = file.value;
	document.getElementById("FImgPath").value = file.value;
	
};

function validateDvdInfo()
{
	if(document.getElementById("FDvdTitle").value == "")
	{
		document.getElementById("lblMessage").innerText=("タイトル" + "空白入力できません");
		return false;
	}
	if(document.getElementById("FYear").value == "")
	{
		document.getElementById("lblMessage").innerText=("制作年" + "空白入力できません");
		return false;
	}
	if(document.getElementById("FType").value == "")
	{
		document.getElementById("lblMessage").innerText=("タイプ" + "空白入力できません");
		return false;
	}
	if(document.getElementById("FDvdTitle").value == "")
	{
		document.getElementById("lblMessage").innerText=("制作国" + "空白入力できません");
		return false;
	}
	if(document.getElementById("FPrice").value == "")
	{
		document.getElementById("lblMessage").innerText=("価額" + "空白入力できません");
		return false;
	}
	if(document.getElementById("FImgPath").value == "")
	{
		document.getElementById("lblMessage").innerText=("ポスター" + "空白入力できません");
		return false;
	}
	if(document.getElementById("FDirector").value == "")
	{
		document.getElementById("lblMessage").innerText=("監督" + "空白入力できません");
		return false;
	}
	if(document.getElementById("FActor").value == "")
	{
		document.getElementById("lblMessage").innerText=("出演" + "空白入力できません");
		return false;
	}
	
	if(document.getElementById("FMemo").value == "")
	{
		document.getElementById("lblMessage").innerText=("内容紹介" + "空白入力できません");
		return false;
	}
	var reg =  /^[0-9]{1,}$/;
	var FYear =document.getElementById("FYear").value;
	if(reg.test(FYear)==false)
	{
		document.getElementById("lblMessage").innerText=("制作年" + "数字以外は入力できません");
		return false;
	}
	var reg =  /^[0-9\.]{1,}$/
	if(reg.test(document.getElementById("FPrice").value)==false)
	{
		document.getElementById("lblMessage").innerText=("価額" + "数字以外は入力できません");
		return false;
	}
	return true;	
};